package data

import (
	"hellomall/internal/conf"

	v3 "go.etcd.io/etcd/client/v3"
)

func NewEtcdClient(c *conf.Registry) *v3.Client {
	cli, err := v3.New(v3.Config{
		Endpoints: []string{c.Etcd.Addr},
		Username:  c.Etcd.Username,
		Password:  c.Etcd.Password,
	})
	if err != nil {
		panic(err)
	}

	return cli
}
